/**********************************************************************************************************************
 *
 * Project:    mGameEngine
 * File:       gpuprogrammaterial.h
 * Author:     karooolek
 * Created on: 2010-04-14
 *
 **********************************************************************************************************************/

#ifndef GPUPROGRAMMATERIAL_H_
#define GPUPROGRAMMATERIAL_H_

#include "material.h"
#include "gpuprogram.h"

namespace mGameEngine
{
namespace Graphics
{

/**
 * GPU program material.
 * Material based on specified GPU program.
 */
class GPUProgramMaterial : public Material
{
protected:
    /**
     * GPU program.
     */
    GPUProgram *_gpuProgram;

public:
    /**
     * Create GPU program material without specified GPU program.
     */
    GPUProgramMaterial(void);
    
    /**
     * Create GPU program material with specified GPU program.
     * @param gpuProgram GPU program.
     */
    GPUProgramMaterial(GPUProgram *gpuProgram);

    /**
     * Destroy GPU program material.
     */
    virtual ~GPUProgramMaterial(void);

    /**
     * Get materials GPU program.
     * @return materials GPU program.
     */
    GPUProgram *getGPUProgram() const
    {
        return _gpuProgram;
    }

    /**
     * Set materials GPU program.
     * @param gpuProgram GPU program.
     */
    void setGPUProgram(GPUProgram *gpuProgram)
    {
        _gpuProgram = gpuProgram;
    }

    /**
     * Set GPU program material as active.
     */
    virtual void set() const;
};

}
}

#endif GPUPROGRAMMATERIAL_H_
